VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form ChequeFrm 
   Caption         =   "Cheque Entry Form"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   WindowState     =   2  'Maximized
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   9360
      Top             =   5160
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   8295
      Left            =   1440
      ScaleHeight     =   8265
      ScaleWidth      =   15345
      TabIndex        =   0
      Top             =   720
      Width           =   15375
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Height          =   495
         Left            =   1440
         TabIndex        =   3
         Top             =   1920
         Width           =   13215
         _ExtentX        =   23310
         _ExtentY        =   873
         _Version        =   393216
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Prepare File"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   13200
         TabIndex        =   2
         Top             =   1320
         Width           =   1215
      End
      Begin MSComCtl2.DTPicker DTPicker1 
         Height          =   375
         Left            =   11400
         TabIndex        =   1
         Top             =   1320
         Width           =   1455
         _ExtentX        =   2566
         _ExtentY        =   661
         _Version        =   393216
         Format          =   55574529
         CurrentDate     =   40188
      End
      Begin VB.Label Label1 
         Caption         =   "Select Date"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   10200
         TabIndex        =   4
         Top             =   1380
         Width           =   1215
      End
   End
End
Attribute VB_Name = "ChequeFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim c As Connection
Dim rs As Recordset
Private Sub Command1_Click()
Call database
MSFlexGrid1.TextMatrix(1, 1) = rs.Fields(0).Name & rs.Fields(0)
MSFlexGrid1.Visible = True
End Sub
Private Sub database()
Set c = New Connection
c.Provider = "Microsoft.Jet.OLEDB.4.0"
c.Open App.Path & "\Jeevan.mdb"
Set rs = New Recordset
rs.CursorLocation = adUseServer
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
If Val(days(DTPicker1.Value)) >= 28 And Month(DTPicker1.Value) = 2 Then
rs.Open "Select * from Customer where PlanNo='PlanA' and DateCom like ('%" & "/" & days(DTPicker1.Value) & "/" & "%' or '%" & "/" & days(DTPicker1.Value) + 1 & "/" & "%' or '%" & "/" & days(DTPicker1.Value) + 2 & "/" & "%' or '%" & "/" & days(DTPicker1.Value) + 3 & "/" & "%')", c
ElseIf Day(Month(DTPicker1.Value)) = 30 And Val(days(DTPicker1.Value)) = 30 Then
rs.Open "Select * from Customer where PlanNo='PlanA' and DateCom like '%" & "/" & days(DTPicker1.Value) & "/" & "%' or '%" & "/" & (Val(days(DTPicker1.Value)) + 1) & "/" & "%'", c
Else
rs.Open "Select * from Customer where PlanNo='PlanA' and DateCom like '%" & "/" & days(DTPicker1.Value) & "/" & "%'", c
End If
MsgBox (rs.RecordCount)
End Sub

Private Sub Form_Load()
MSFlexGrid1.Visible = False
Adodc1.Visible = False
End Sub
